# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-filequeue
pkgname=('python2-filequeue' 'python-filequeue')
_pkgname=filequeue
pkgver=0.4.1
pkgrel=6
pkgdesc='A thread-safe queue object which is interchangeable with the stdlib Queue.'
arch=('any')
url='https://pypi.org/project/filequeue/#files'
license=('BSD')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('d95bcdf2d2e079e631d99b9b9929c9a9d773eff6b89140bd994b7490cc39379c6019e69edf39d579bd538c9c4b264825136c51a9ab3b78fd16d9cd1e1e6affe2')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-filequeue() {
  depends=('python2')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" -O1 --skip-build
}

package_python-filequeue() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" -O1 --skip-build
}

